﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Domain.Dto;
using Domain.Dto.User;
using Gmmy.DomainExtension;
using Gmmy.Utility;
using Surging.Core.Caching;
using Surging.Core.CPlatform.Filters.Implementation;
using Surging.Core.CPlatform.Ioc;
using Surging.Core.CPlatform.Runtime.Server.Implementation.ServiceDiscovery.Attributes;
using Surging.Core.CPlatform.Support;
using Surging.Core.CPlatform.Support.Attributes;
using Surging.Core.System.Intercept;

namespace Application.Interface
{
    [ServiceBundle("api/{Service}")]
    public interface IUserService : IServiceKey
    {
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Command(Strategy = StrategyType.Injection, ExecutionTimeoutInMilliseconds = 30000, BreakerRequestVolumeThreshold = 3, Injection = @"return null;", RequestCacheEnabled = false)]
        Task<CustomApiResult> Login(LoginInput input);
        /// <summary>
        /// 获取用户基本信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Command(Strategy = StrategyType.Injection, ExecutionTimeoutInMilliseconds = 30000, BreakerRequestVolumeThreshold = 3, Injection = @"return null;", RequestCacheEnabled = false)]
        Task<CustomApiResult> Info(EmptyRequest input);
        /// <summary>
        /// 修改用户基本信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Authorization(AuthType = AuthorizationType.JWT)]
        Task<CustomApiResult> ChangeUserInfo(UpdateUserInput input);
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Authorization(AuthType = AuthorizationType.JWT)]
        [Command(Strategy = StrategyType.Injection, ExecutionTimeoutInMilliseconds = 30000, BreakerRequestVolumeThreshold = 3, Injection = @"return null;", RequestCacheEnabled = false)]
        Task<CustomApiResult> GetList(UserListInput input);

        /// <summary>
        /// 获取用户详情
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Authorization(AuthType = AuthorizationType.JWT)]
        [Command(Strategy = StrategyType.Failover, ExecutionTimeoutInMilliseconds = 30000, BreakerRequestVolumeThreshold = 3, Injection = @"return null;", RequestCacheEnabled = false)]
        Task<CustomApiResult> Get(GetInput input);


        /// <summary>
        /// 修改用户基本信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Authorization(AuthType = AuthorizationType.JWT)]
        Task<CustomApiResult> CreateUserInfo(UpdateUserInput input);



        /// <summary>
        /// 修改用户状态
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Authorization(AuthType = AuthorizationType.JWT)]
        Task<CustomApiResult> ChangeUserState(GetInput input);
    }
}
